<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="com.yaodian100.core.common.utils.ServerValue"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ include file="/taglibs.jsp"%>
<link rel="stylesheet" type="text/css" media="screen" href="/css/ui.jqgrid.css" />
<link href="/css/ddaccordion.css" rel="stylesheet" type="text/css" media="screen" />
<script src="/js/jquery.MultiFile.js" type="text/javascript" language="javascript"></script> 
<script src="/js/grid.locale-en.js" type="text/javascript"></script>
<script src="/js/jquery.jqGrid.min.js" type="text/javascript" charset="UTF-8"></script>
<script language="javascript">
	$().ready(function(){
		$("#mainSubmit").click(function(){
			if ( "" == $("#MultiFile8_F1").val()){
				alert("尚未选择上传档案，请重新选择！");
				return false;
			}else if($.trim($("#supplierIdParam").val())==""){
				alert("供应商为必填");
				$("#supplierIdParam").focus();
				return false;
			}else if(($("#supplierIdParam").val()=="010000"||$("#supplierIdParam").val()=="010001")&&$.trim($("#twSupplierIdParam").val())==""){
				alert("若供应商为万美供应商，台湾供应商为必填");
				$("#twSupplierIdParam").focus();
				return false;
			}else return true;
		});
		$("#getSupplier").click(function() {
			//qry_target = 'member';
			$("#spId").val("");
			$("#spName").val("");
			doAR('<s:url value="/json/supplierPops.do"/>', 'dialog'); 
			openDialog('供应商搜寻',content, 550, 440);
		});	
		$("#getTwSupplier").click(function() {
			//qry_target = 'member';
			$("#spId").val("twSupplierIdParam");
			$("#spName").val("twSupplierCompanyName");
			doAR('<s:url value="/json/supplierPops.do"/>', 'dialog'); 
			openDialog('供应商搜寻',content, 550, 440);
		});	
		
	});
</script>	
<div style="color.red">
	<s:fielderror />
</div>
<div id="content"></div>
<h1>Excel 批量上传</h1>
  <div class="data-form">
    <div class="batchtips">
    ﻿      <h3>Excel批量上传使用说明</h3>
      <div>您可利用excel提报表，一次建立多笔商品资料。步骤如下：<br>
      1. 准备档案：请先下载 "<a href="<s:url value="/docs/YaodianProduct_PM_0304_2.xls"/>" target="_blank">PM专用exce上传表</a>" ，将商品信息填入表格内。<br>
	  2. 上传档案：将填妥的excel提报表上传。<br>
      3. 上传图片：将对应的图片档上传。<br>
      上传成功后，您的商品就会进入 "商品管理" 列表页。
	  </div>
      <div><a href="<s:url value="/docs/YaodianProduct_PM_0304_2.xls"/>" target="_blank">下载PM专用excel上传表</a></div>
      <div class="txt-red">请注意：<br>由于栏位不同，PM与供应商使用的提报表并不一样，<br>请检查您上传的版本为PM用版本。</div>
    </div>
    <span>使用excel批量上传之商品，销售状态将预设为 "N可销售, 可查询"。</span><br><br>
     <s:form action ="preview.do" method ="post" enctype ="multipart/form-data" >
    <table style="width:53%;clear:none;" class="tb-data">
      <tbody><tr>
        <th width="150"><span class="txt-red">*</span>供应商编号</th>
        <td><span><s:textfield name="editsupplier" id="supplierIdParam"  maxlength="6" readonly="true"/>
			<img class="ui-icon ui-icon-search" src="/images/none.gif" style="height:16px; width:16px; position:relative; display:inline;" 	id="getSupplier"/></span></td>
      </tr>
      <tr id="twSupplier" style="display:none;">
        <th><span class="txt-red">*</span>台湾供应商</th>
        <td><span><s:textfield name="editTwSupplier" id="twSupplierIdParam"  maxlength="6" readonly="readonly"/>
			<img class="ui-icon ui-icon-search" src="/images/none.gif" style="height:16px; width:16px; position:relative; display:inline;" id="getTwSupplier"/></span></td>
      </tr>
      <tr>
        <th><span class="txt-red">*</span>选择要提报的Excel文档</th>
        <td><input id="MultiFile8_F1" class="multi accept-xls" maxlength="1" type="file" name="upload"  accept="xls"/><BR> 
          <br><span class="txt-gy">上传档案限excel文档</span></td>
      </tr>
    </tbody></table>
    <br>
    <input type="hidden" id="spId" value=""/>
	<input type="hidden" id="spName" value=""/>
    <s:submit id="mainSubmit" value="上传" />
    </s:form>
  </div>